package unilearn.facade;

import java.sql.*;
import java.util.Vector;

import unilearn.da.DASubject;
import unilearn.domain.Subject;

public class SubjectFacade
{
	public static Vector<Subject> getAllSubjects() throws SQLException
	{ return DASubject.getAllSubjects();	}
	
	public static Subject getSubjectByID(long subjectID) throws SQLException
	{ 
		Subject sub = DASubject.getSubjectByID(subjectID); 
		
		sub.setAssignment(AssignmentFacade.getAssignmentBySubject(sub.getSubjectID()));
	
		return sub;
	}
	
	public static Subject getSubjectByCode(String subjectCode) throws SQLException
	{ return DASubject.getSubjectByCode(subjectCode); }
}
